﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Mapbox.Map;
using Mapbox.Utils;

public class RouteModel
{
    private static RouteModel instance;
    public static RouteModel Instance
    {
        get
        {
            if (instance == null)
            {
                instance = new RouteModel();
            }
            return instance;
        }
    }
    private List<UnwrappedTileId> routeTileCache = new List<UnwrappedTileId>();
    /// <summary>
    /// 地图切片数据的缓存
    /// </summary>
    public List<UnwrappedTileId> RouteTileCache
    {
        get
        {
            routeTileCache.Sort(new SortRoute());
            return routeTileCache;
        }
    }

    private List<Vector2d> routePointCache = new List<Vector2d>();
    /// <summary>
    /// 路线经纬度坐标点的缓存
    /// </summary>
    public List<Vector2d> RoutePointCache
    {
        get
        {
            return routePointCache;
        }
    }

    public void Clear()
    {
        routeTileCache.Clear();
        routePointCache.Clear();
    }
}
